//数据库连接池
extern crate r2d2;
extern crate log;
extern crate env_logger;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate serde_json;
use log::Level;
use actix_web::{ middleware::Logger, App, HttpServer};
//web服务
mod webservice;
//数据库操作
mod dboper;

#[actix_web::main]
async fn main() -> std::io::Result<()> {
    // access logs are printed with the INFO level so ensure it is enabled by default
    env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

    HttpServer::new(|| {
        App::new()
		    .wrap(Logger::default())
            .service(webservice::test::db2querytest::grouplist)
    })
	
    .bind("0.0.0.0:8080")?
    .run()
    .await
}
